#include <iostream>
#include <math.h>
using namespace std;

int main()
{
    int n, a, b, x, y;
    cin >> n;
    while (n-->0)
    {
        cin >> a >> b;
        x = (a+b)/2;
        y = a-x;
        if (y>=0 && x+y==a && abs(x-y)==b ) cout << x << " "<< y << endl;
        else cout<< "impossible" << endl;
        
    }    
}    